<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 刘敏
  Date: 2024/3/26
  Time: 10:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>商品列表</title>
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.css">
    <script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.js"></script>
</head>
<body>

<form class="form-horizontal" role="form">
    <div class="form-group">
        <label for="pname" class="col-sm-2 control-label">商品名称</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" id="pname" placeholder="请输入商品名称" value="${product.pname}" name="pname">
            <input type="hidden" name="pid" value="${product.pid}">
        </div>
    </div>
    <div class="form-group">
        <label for="price" class="col-sm-2 control-label">商品价格</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" id="price" placeholder="请输入商品价格" value="${product.price}" name="price">
        </div>
    </div>
    <div class="form-group">
        <label for="num" class="col-sm-2 control-label">商品数量</label>
        <div class="col-sm-8">
            <input type="text" class="form-control" id="num" placeholder="请输入商品数量" value="${product.num}" name="num">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">商品描述</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="3" name="desc">${product.desc}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">所属类别</label>
        <div class="col-sm-8">
            <select class="form-control" name="tid">
               <c:forEach items="${typeList}" var="type">
                   <option value="${type.tid}" <c:if test="${product.tid==type.tid}"></c:if> >${type.tname}</option>
               </c:forEach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-6 col-sm-6">
            <button type="submit" class="btn btn-default">修改</button>
        </div>
    </div>
</form>

</body>
</html>
